﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RxxApi.Common.Seed;

public class MyContext
{
<<<<<<< HEAD
    /// <summary>
    /// 功能描述:构造函数
    /// 作　　者:Blog.Core
    /// </summary>
    public MyContext(ISqlSugarClient sqlSugarClient)
    {
        if (string.IsNullOrEmpty(_connectionString))
            throw new ArgumentNullException("数据库连接字符串为空");

        _db = sqlSugarClient as SqlSugarScope;

    }
=======
    private SqlSugarScope _db;
    public MyContext(ISqlSugarClient sqlSugarClient)
    {
        _db = sqlSugarClient as SqlSugarScope;
    }
    
    /// <summary>
    /// 数据连接对象 
    /// Blog.Core 
    /// </summary>
    public SqlSugarScope Db
    {
        get { return _db; }
        private set { _db = value; }
    }

    #region 实例方法
    /// <summary>
    /// 功能描述:获取数据库处理对象
    /// 作　　者:Blog.Core
    /// </summary>
    /// <returns>返回值</returns>
    public SimpleClient<T> GetEntityDB<T>() where T : class, new()
    {
        return new SimpleClient<T>(_db);
    }
    #endregion
>>>>>>> 978f3e50234340b2479b3d4d960a10aa408b09d0
}
